# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=perl-http-cookiejar
_pkgreal=HTTP-CookieJar
pkgver=0.008
pkgrel=1
pkgdesc="A minimalist HTTP user agent cookie jar"
url="https://metacpan.org/release/HTTP-CookieJar"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-http-date perl-time-local"
cpanmakedepends=""
cpancheckdepends="perl-test-deep perl-test-requires"
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {                                                                  
        cd "$builddir"                                                     
        export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')           
        make test                                                          
}                                                                          

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="6e85c22084ba2959b385f4cd706b2b937fcdb68f219ee03ccdd69dd2a01ff34b72bf7f442e414e3da43199fc43624b781af0c7599f856dc580a5d0a7742c6aff  HTTP-CookieJar-0.008.tar.gz"
